package com.project.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(value = "Order1",description = "订单信息")
public class Order1 implements Serializable,Cloneable {
    /**
     * 订单ID
     */
    @ApiModelProperty(value = "[自动增长]订单主键")
    private Integer order_id;
    /**
     * 订单用户ID
     */
    @ApiModelProperty(value = "订单用户id")
    private Integer order_user_id;
    @ApiModelProperty(value = "用户实体类")
    private Users users;
    /**
     * 车位ID
     */
    @ApiModelProperty(value = "订单车位id")
    private Integer order_stall_id;
    @ApiModelProperty(value = "车位实体类")
    private Stall stall;
    /**
     * 车辆ID
     */
    @ApiModelProperty(value = "订单车辆id")
    private Integer order_vehicle_id;
    @ApiModelProperty(value = "订单车辆")
    private Vehicle vehicle;
    /**
     * 开始时间
     */
    @ApiModelProperty(value = "订单开始时间")
    @NotNull
    private Date order_startime;
    /**
     * 结束时间
     */

    @ApiModelProperty(value = "订单结束时间")
    private Date order_endtime;
    /**
     * 金额
     */
    @ApiModelProperty(value = "订单金额")
//    @Pattern(regexp = "/^([1-9]\\d{0,9}|0)(\\.\\d{1,2})?$/",message = "订单金额格式错误")
    private Double order_money;
    //车牌号
    @ApiModelProperty(value = "[必填项]订单车牌号")
    @Pattern(regexp = "/^$|^([京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][1-9DF][1-9ABCDEFGHJKLMNPQRSTUVWXYZ]\\d{3}[1-9DF]|[京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][\\dABCDEFGHJKLNMxPQRSTUVWXYZ]{5})$/",message = "车牌号格式错误")
    private String order_vehicle_code;
    /**
     * 订单状态
     */
    @ApiModelProperty(value = "订单状态")
    @Pattern(regexp = "/\\b(已完成|进行中)\\b/",message = "订单状态错误")
    private String order_state;
}
